package Eyjafjalla.relic;

import Eyjafjalla.helper.StringHelper;
import basemod.abstracts.CustomRelic;
import com.megacrit.cardcrawl.actions.common.GainBlockAction;
import com.megacrit.cardcrawl.actions.common.RelicAboveCreatureAction;
import com.megacrit.cardcrawl.dungeons.AbstractDungeon;
import com.megacrit.cardcrawl.helpers.ImageMaster;
import com.megacrit.cardcrawl.monsters.AbstractMonster;
import com.megacrit.cardcrawl.relics.AbstractRelic;

public class NightInForest extends CustomRelic {

    public static final String ID = "eyjafjalla:NightInForest";

    public NightInForest(){
        super(ID, ImageMaster.loadImage(StringHelper.getRelicIMGPATH(ID,false)),ImageMaster.loadImage(StringHelper.getRelicIMGPATH(ID,true)),RelicTier.COMMON,LandingSound.MAGICAL);
    }

    @Override
    public void onPlayerEndTurn() {
        for(AbstractMonster m: AbstractDungeon.getMonsters().monsters){
            if(!m.isDeadOrEscaped()&&m.getIntentBaseDmg()>0){
                addToBot(new RelicAboveCreatureAction(m,this));
                addToBot(new GainBlockAction(AbstractDungeon.player,m,3));
            }
        }
    }

    @Override
    public String getUpdatedDescription() {
        return DESCRIPTIONS[0];
    }

    @Override
    public AbstractRelic makeCopy() {
        return new NightInForest();
    }
}




